module.exports = function(grunt) {
  // 配置
  grunt.initConfig({
    pkg : grunt.file.readJSON('package.json'),
    concat : {
      logger : {
        src: [
          'static/js/vue2.5.js',
          'static/js/jquery3.0.js',
          'static/js/bootstrap3.3.4.js',
          'static/js/prism1.14.js',
          'static/js/prism-json.js',
          'static/js/prism-toolbar.js',
          'static/js/jquery-ui1.12.js',
          'static/js/layer3.0.3.js',
          'static/js/bootstrap-paginator.min.js',
          'static/js/script.js',
        ],
        dest: 'static/build/logger.js'
      },
      css: {
        src: [
          'static/css/bootstrap3.3.4.min.css',
          'static/css/prism1.14.0.min.css',
          'static/css/prism1.14-toolbar.min.css',
          'static/css/custom.css',
        ],
        dest: 'static/build/logger.css'
      }
    },
    uglify : {
      options : {
        banner : '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build : {
        src : 'static/build/logger.js',
        dest : 'static/build/logger.min.js'
      }
    },
    cssmin: {
      options: {
        mergeIntoShorthands: false,
        roundingPrecision: -1
      },
      target: {
        files: {
          'static/build/logger.min.css': ['static/build/logger.css']
        }
      }
    }
  });
  // 载入concat和uglify插件，分别对于合并和压缩
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  // 注册任务
  grunt.registerTask('default', ['concat', 'uglify', 'cssmin']);
};